Konstantin Kharlamov [Thu, 5 Aug 2021 15:25:56 +0000 (18:25 +0300)]
Reset mtime of a buffer reverted "delicately"
* lisp/files.el (revert-buffer-insert-file-contents-delicately):
Once buffer is reverted, reset its mtime to that of the file.
(Bug#49893)
Eli Zaretskii [Thu, 5 Aug 2021 17:42:10 +0000 (20:42 +0300)]
Fix files-tests on non-Posix systems
* test/lisp/files-tests.el (files-test-auto-save-name-default)
(files-test-auto-save-name-transform)
(files-test-auto-save-name-unique, files-test-lock-name-default)
(files-test-lock-name-unique): Skip the drive letter in absolute
file names on MS-Windows/MS-DOS when comparing file names against
the expected ones.
(files-tests-file-name-non-special--subprocess): Skip test on
MS-Windows/MS-DOS.
Mattias Engdegård [Thu, 5 Aug 2021 09:50:25 +0000 (11:50 +0200)]
Cease attempts to const-propagate through setq
The current method of propagating constants through setq was unsound
because it relied on each setq form only being traversed at most once
during optimisation, which isn't necessarily true in general; it could
be made to miscompile code in rare cases.
Since it was only used in limited circumstances, disabling this
optimisation doesn't cost us much.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Don't update the known value when traversing `setq`.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test case.
Lars Ingebrigtsen [Thu, 5 Aug 2021 11:14:26 +0000 (13:14 +0200)]
Fix M-n description in refcards
* etc/refcards/pl-refcard.tex (section{Szukanie przyrostowe}):
Ditto (in comments).
* etc/refcards/refcard.tex (section{Incremental Search}): Fix M-n
description (bug#49872).
Basil L. Contovounesios [Thu, 5 Aug 2021 10:40:31 +0000 (11:40 +0100)]
; Fix oauth typos in last change.
Roland Winkler [Thu, 5 Aug 2021 10:33:21 +0000 (12:33 +0200)]
Add support for the oauth2.el library in nnimap and smtpmail
* doc/misc/gnus.texi (Customizing the IMAP Connection):
* doc/misc/smtpmail.texi (Authentication): Mention it.
* lisp/gnus/nnimap.el (nnimap-login): Support oauth2.
* lisp/mail/smtpmail.el (smtpmail-try-auth-method): New function
for oauth2.
Glenn Morris [Thu, 5 Aug 2021 00:42:55 +0000 (17:42 -0700)]
* lisp/cus-start.el (read-minibuffer-restore-windows): Fix entry.
Juri Linkov [Wed, 4 Aug 2021 20:43:21 +0000 (23:43 +0300)]
* lisp/vc/smerge-mode.el (smerge-mode-menu): Add menu item for smerge-refine.
dickmao [Wed, 4 Aug 2021 08:50:38 +0000 (10:50 +0200)]
Package archive location needs to be absolute filename
* lisp/emacs-lisp/package.el (package--with-response-buffer-1):
Actually check that URL is absolute (bug#49788).
Lars Ingebrigtsen [Wed, 4 Aug 2021 08:35:53 +0000 (10:35 +0200)]
Add a new thing-at-point type: existing-filename
* doc/lispref/text.texi (Buffer Contents): Mention it.
* lisp/thingatpt.el (thing-at-point-file-at-point): New function.
(existing-filename): Register it.
Lars Ingebrigtsen [Wed, 4 Aug 2021 08:03:12 +0000 (10:03 +0200)]
Make `M-j' work reliably if `comment-auto-fill-only-comments' is set
* lisp/simple.el (default-indent-new-line): Force breaking the
line when called interactively (bug#49849). (Perhaps the
interactive command should be rebound and call this function
instead...)
Lars Ingebrigtsen [Wed, 4 Aug 2021 07:38:45 +0000 (09:38 +0200)]
Improve `define-globalized-minor-mode' doc strings
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Copy the description from easy-mmode--arg-docstring (bug#49843).
dickmao [Tue, 3 Aug 2021 16:02:48 +0000 (12:02 -0400)]
ffap ido accommodation
Now that ffap-file-finder can be ido-find-file, the
noninteractive portion of find-file-at-point cannot
assume ffap-file-finder always takes an argument
(ido-find-file does not).
* lisp/ffap.el (find-file-at-point): Do not call ffap-file-finder.
* test/lisp/ffap-tests.el (ffap-ido-mode): Test it.
Miha Rihtaršič [Wed, 4 Aug 2021 07:15:25 +0000 (09:15 +0200)]
Use `abort-minibuffers' in delsel
* lisp/delsel.el (minibuffer-keyboard-quit): Use
`abort-minibuffers' (bug#49821).
Previously, C-g was bound to abort-recursive-edit, now it is bound to
abort-minibuffers. However, after requiring delsel, it gets bound to
minibuffer-keyboard-quit, which still uses abort-recursive-edit. Use
the new function instead.
martin rudalics [Wed, 4 Aug 2021 06:48:18 +0000 (08:48 +0200)]
Add new user option 'read-minibuffer-restore-windows'
* doc/lispref/minibuf.texi (Text from Minibuffer): Document it
(bug#45072).
* lisp/cus-start.el (standard): Add.
* src/minibuf.c (syms_of_minibuf): New variable
'read-minibuffer-restore-windows'.
Lars Ingebrigtsen [Wed, 4 Aug 2021 05:34:36 +0000 (07:34 +0200)]
Update outdated Gnus information
* doc/misc/gnus.texi (History): Update information.
Phil Sainty [Wed, 4 Aug 2021 05:17:23 +0000 (17:17 +1200)]
; * lisp/so-long.el: Bump version for the GNU ELPA build
GNU ELPA released commit
359a8e4eda047b7dcb7e64faff7f8eaacf5d937c as
version 1.1.
Lars Ingebrigtsen [Wed, 4 Aug 2021 04:38:34 +0000 (06:38 +0200)]
Fix apparent typo in new cl-generic-tests.el test case
Stefan Monnier [Tue, 3 Aug 2021 23:02:11 +0000 (19:02 -0400)]
* lisp/emacs-lisp/cl-generic.el (cl-generic-generalizers): Don't emit warning
Also remove "WARNING" annotations after confirming that he code was right.
akater [Tue, 20 Jul 2021 01:25:01 +0000 (01:25 +0000)]
Evaluate eql specializers
* lisp/emacs-lisp/cl-generic.el (cl-generic-generalizers): Evaluate
forms that are eql specializers. Provide backward compatibility
with a warning.
* test/lisp/emacs-lisp/cl-generic-tests.el: Add a test.
* lisp/emacs-lisp/bindat.el (bindat--type): Adhere to the new rule.
* lisp/emacs-lisp/edebug.el (edebug--match-&-spec-op): Adhere to the new rule.
* lisp/emacs-lisp/map.el (map-into): Adhere to the new rule.
* lisp/emacs-lisp/radix-tree.el (map-into): Adhere to the new rule.
* lisp/frame.el (cl-generic-define-context-rewriter): Adhere to the new rule.
* lisp/gnus/gnus-search.el
(gnus-search-transform-expression): Adhere to the new rule.
* lisp/image/image-converter.el
(image-converter--probe image-converter--convert): Adhere to the new rule.
* lisp/mail/smtpmail.el (smtpmail-try-auth-method): Adhere to the new rule.
* lisp/progmodes/elisp-mode.el
(xref-backend-definitions)
(xref-backend-apropos): Adhere to the new rule.
* lisp/progmodes/etags.el (xref-backend-identifier-at-point)
(xref-backend-identifier-completion-table)
(xref-backend-identifier-completion-ignore-case)
(xref-backend-definitions)(xref-backend-apropos): Adhere to the new rule.
* test/lisp/emacs-lisp/checkdoc-tests.el
(checkdoc-cl-defmethod-with-types-ok)
(checkdoc-cl-defmethod-qualified-ok)
(checkdoc-cl-defmethod-with-extra-qualifier-ok): Adhere to the new rule.
* etc/NEWS: Describe the change.
Lars Ingebrigtsen [Tue, 3 Aug 2021 17:41:57 +0000 (19:41 +0200)]
file-name-concat is not error free
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Declare
file-name-concat as side-effect free.
Lars Ingebrigtsen [Tue, 3 Aug 2021 17:08:43 +0000 (19:08 +0200)]
Declare file-name-concat as side-effect free
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Declare
file-name-concat as side-effect (and error) free.
Mattias Engdegård [Tue, 3 Aug 2021 13:55:55 +0000 (15:55 +0200)]
Remove ineffective expression in verilog-mode
* lisp/progmodes/verilog-mode.el (verilog-set-auto-endcomments):
Remove expression that now elicits a byte-compiler warning.
Mattias Engdegård [Tue, 3 Aug 2021 13:28:10 +0000 (15:28 +0200)]
Declare `match-beginning` and `match-end` as side-effect-free
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Add functions.
Phil Sainty [Tue, 3 Aug 2021 11:42:35 +0000 (23:42 +1200)]
Merge branch 'scratch/so-long'
Phil Sainty [Sat, 16 Jan 2021 12:25:13 +0000 (01:25 +1300)]
Make `global-so-long-mode' use `buffer-line-statistics'
* lisp/so-long.el: (so-long-statistics-excessive-p): New predicate
function using `buffer-line-statistics'.
(so-long-predicate): Use `so-long-statistics-excessive-p' by default.
* etc/NEWS: Describe changes.
* test/lisp/so-long-tests/so-long-tests-helpers.el:
* test/lisp/so-long-tests/so-long-tests.el: Update tests.
Also improve the existing `so-long-tests-predicate' tests.
Phil Sainty [Fri, 30 Jul 2021 01:46:00 +0000 (13:46 +1200)]
; Revert "Make `so-long' restore `view-mode'"
This reverts commit
3c2db0c541491fceb7081d5b54de5abec25e2f4b.
A more general solution to bug#45084 has been implemented via
new user options `so-long-mode-preserved-variables' and
`so-long-mode-preserved-minor-modes'.
See the previous commit (before this revert) for details.
Phil Sainty [Sun, 10 Jan 2021 02:02:58 +0000 (15:02 +1300)]
Support 'preserved' variables and minor modes in `so-long-mode'
The default values support preserving the state of `view-mode' when
switching to (and reverting from) `so-long-mode' (bug#45084).
* lisp/so-long.el (so-long-mode-preserved-variables)
(so-long-mode-preserved-minor-modes): New user options.
(so-long-mode-maintain-preserved-variables)
(so-long-mode-maintain-preserved-minor-modes): New functions.
(so-long-remember-all, so-long-after-change-major-mode)
(so-long-mode-revert): Use them.
* etc/NEWS: Describe changes.
* test/lisp/so-long-tests/so-long-tests-helpers.el:
* test/lisp/so-long-tests/so-long-tests.el: Update tests.
Phil Sainty [Sat, 20 Mar 2021 08:48:18 +0000 (21:48 +1300)]
; so-long-tests.el: Suppress expected warnings
* test/lisp/so-long-tests/so-long-tests.el
(so-long-tests-invisible-buffer-function): Suppress warning about
obsolete function `run-window-configuration-change-hook', as we are
using it intentionally (see the preceding code comments and URL for
details).
Phil Sainty [Sun, 10 Jan 2021 02:20:51 +0000 (15:20 +1300)]
; * lisp/so-long.el: Minor bug fixes
(so-long-disable-minor-modes): Don't call the mode function to disable
the mode unless it was actually enabled.
(so-long-restore-minor-modes, so-long-restore-variables): Use the
remembered list values, which might be different to the defaults.
Also comments, and spelling consistency changes for the so-long tests
(a fixup for commit
83bc4ad369 which had only addressed so-long.el,
and not the test files).
Phil Sainty [Fri, 3 Jul 2020 13:44:32 +0000 (01:44 +1200)]
* lisp/so-long.el (so-long-minor-modes): Additional modes to disable
Phil Sainty [Sun, 10 Jan 2021 01:43:16 +0000 (14:43 +1300)]
Make `global-so-long-mode' handle unrecognised file types
* lisp/so-long.el (so-long-target-modes): Add `fundamental-mode'
* etc/NEWS: Describe changes.
This doesn't affect buffers which are simply in `fundamental-mode' by
default. It only affects buffers for which `set-auto-mode' has been
called (normally via `find-file') without establishing a different
major mode.
Phil Sainty [Sun, 10 Jan 2021 01:29:32 +0000 (14:29 +1300)]
Increase `so-long-threshold' and `so-long-max-lines' defaults
* lisp/so-long.el (so-long-threshold, so-long-max-lines): Increase
default values to reduce false-positives.
* etc/NEWS: Describe changes.
Lines shorter than 10,000 characters shouldn't generally be causing
problems, so testing this explicitly will largely eliminate
false-positives. We must also increase the maximum number of lines
to check, because 'minified' code may still include newlines, and so
there may be many lines shorter than the new threshold before we find
a line which exceeds it.
Previously we used a minimum-effort heuristic, testing a very small
number of lines against a maximum length which, while not remotely
long enough to cause problems, would nevertheless be uncommon in any
normal file of programming code (and hence indicative that the file
was likely to be minified code).
Testing indicates that the performance penalty for the larger values
should be negligible.
Phil Sainty [Sun, 10 Jan 2021 01:28:17 +0000 (14:28 +1300)]
; * lisp/so-long.el: Bump to version 1.1
Phil Sainty [Sun, 10 Jan 2021 12:58:26 +0000 (01:58 +1300)]
; * lisp/so-long.el: Documentation
Jimmy Yuen Ho Wong [Tue, 3 Aug 2021 07:14:38 +0000 (08:14 +0100)]
* Fix error while disassembling native code on macOS
* lisp/emacs-lisp/disass.el (disassemble-internal): Make sure the
regexp that searches for a symbol takes into account of llvm-objdump's
output format.
Amin Bandali [Tue, 3 Aug 2021 02:39:43 +0000 (22:39 -0400)]
Merge from origin/emacs-27
75ecce4323 Unbreak ERC's Ibuffer filter (Bug#44100)
Amin Bandali [Tue, 3 Aug 2021 02:39:43 +0000 (22:39 -0400)]
; Merge from origin/emacs-27
The following commit was skipped:
61def1e392 ; Auto-commit of loaddefs files.
Olivier Certner [Tue, 6 Jul 2021 08:51:57 +0000 (10:51 +0200)]
Unbreak ERC's Ibuffer filter (Bug#44100)
* lisp/erc/erc-ibuffer.el (erc-modified): Don't use `length' on dotted
lists (and not even to test if there is more than one element, for
that matter). Use `cdr' instead.
Juri Linkov [Mon, 2 Aug 2021 22:08:23 +0000 (01:08 +0300)]
Adjust tab-bar to the new mode-line-misc-info value (bug#49806)
* lisp/tab-bar.el (tab-bar--define-keys): Adjust to the new
default value for `mode-line-misc-info'.
Stephen Gildea [Mon, 2 Aug 2021 04:07:52 +0000 (21:07 -0700)]
; mh-junk-background: fix documentation typo
* lisp/mh-e/mh-e.el (mh-junk-background), doc/misc/mh-e.texi:
In documentation, name the correct argument to call-process.
Stephen Gildea [Mon, 2 Aug 2021 04:00:37 +0000 (21:00 -0700)]
mh-junk: adjust messages for allow/block actions
* lisp/mh-e/mh-junk.el: Remove messages that get overwritten quickly.
Keep messages that give status for slow operations. Add information
that might be useful for debugging failures.
Stefan Monnier [Sun, 1 Aug 2021 22:13:41 +0000 (18:13 -0400)]
* lisp/mwheel.el: Don't use `custom-initialize-delay`.
Set up the keybindings when loading the file.
(mouse-wheel--installed-bindings-alist): Move to beginning.
(mouse-wheel-change-button): Don't update bindings when they're not installed.
(mouse-wheel--setup-bindings): New function extracted from `mouse-wheel-mode`.
(<topleve>): Call it when loading the file.
(mouse-wheel-mode): Use the default :initializer.
Stefan Monnier [Sun, 1 Aug 2021 22:08:01 +0000 (18:08 -0400)]
* lisp/progmodes/flymake.el (flymake--mode-line-title): Don't quote lambda
Juri Linkov [Sun, 1 Aug 2021 20:43:37 +0000 (23:43 +0300)]
* lisp/progmodes/project.el (project-switch-project): Use 'let*' (bug#49635).
This allows overriding-local-map to have effect on read-key-sequence.
Juri Linkov [Sun, 1 Aug 2021 19:58:09 +0000 (22:58 +0300)]
* lisp/emacs-lisp/autoload.el (autoload--make-defs-autoload): Display warning.
https://lists.gnu.org/archive/html/emacs-devel/2021-08/msg00007.html
Mattias Engdegård [Sun, 1 Aug 2021 15:05:48 +0000 (17:05 +0200)]
Make dlet work like let, not let*
Change `dlet` so that it has binding semantics like `let` because that
is what a user would expect and it allows a corresponding `dlet*` to
be added later should the need arise. Fortunately the change has no
effect where it is currently used.
* lisp/subr.el (dlet): Work like let.
* lisp/calendar/cal-bahai.el (calendar-bahai-date-string):
* lisp/calendar/cal-coptic.el (calendar-coptic-date-string):
* lisp/calendar/cal-dst.el (calendar-time-zone-daylight-rules)
(calendar-dst-starts, dst-in-effect):
* lisp/calendar/cal-persia.el (calendar-persian-date-string):
* lisp/calendar/calendar.el (calendar-dlet, calendar-generate-month)
(calendar-update-mode-line, calendar-date-string):
* lisp/calendar/diary-lib.el (diary-list-entries-2)
(diary-list-entries, diary-mark-entries-1, diary-sexp-entry)
(diary-remind, diary-font-lock-date-forms, diary-fancy-date-pattern):
* lisp/calendar/holidays.el (holiday-sexp):
* lisp/calendar/icalendar.el (icalendar--convert-float-to-ical):
* lisp/calendar/solar.el (solar-time-string):
* lisp/calendar/todo-mode.el (todo-date-pattern)
(todo-edit-item--header, todo-convert-legacy-date-time)
(todo-read-date):
Rename `calendar-dlet*` to `calendar-dlet` since it uses `dlet`.
Glenn Morris [Sun, 1 Aug 2021 13:29:49 +0000 (06:29 -0700)]
; Auto-commit of loaddefs files.
Mattias Engdegård [Sun, 1 Aug 2021 13:25:02 +0000 (15:25 +0200)]
; * lisp/replace.el (occur--set-arrow): Remove unused variable.
Glenn Morris [Sun, 1 Aug 2021 13:12:18 +0000 (06:12 -0700)]
; Auto-commit of loaddefs files.
Mattias Engdegård [Sun, 1 Aug 2021 09:52:00 +0000 (11:52 +0200)]
Indicate selected occur target with fringe arrow
* lisp/replace.el (occur--set-arrow): New function.
(occur-mode-goto-occurrence)
(occur-mode-goto-occurrence-other-window)
(occur-mode-display-occurrence): Call it.
* etc/NEWS: Announce.
Juri Linkov [Sun, 1 Aug 2021 08:38:51 +0000 (11:38 +0300)]
* lisp/filecache.el: Fix cycling (bug#49761).
(file-cache-cycle): Refactor from file-cache-minibuffer-complete.
(file-cache-minibuffer-complete): Use file-cache-cycle in 2 old places,
and in 1 following new place. When last-command is equal to this-command,
use file-cache-cycle to continue cycling the previous completion
as long as the user continues typing C-TAB.
Also when displaying a list of completions, don't try to move point
to the common prefix.
Kévin Le Gouguec [Sat, 31 Jul 2021 21:54:06 +0000 (23:54 +0200)]
Extend Gnus summary highlight faces by default
* lisp/gnus/gnus.el (gnus-summary-selected):
(gnus-summary-normal-ancient):
(gnus-summary-normal-undownloaded):
(gnus-summary-normal-unread):
(gnus-summary-normal-read): Set :extend attribute.
Lars Ingebrigtsen [Sat, 31 Jul 2021 22:01:59 +0000 (00:01 +0200)]
Adjust the fully qualified host name when nothing is set
* doc/misc/message.texi (News Headers): Adjust index.
* lisp/gnus/message.el (message-check-news-header-syntax): Adjust check.
(message-make-fqdn): Be less hilarious.
Lars Ingebrigtsen [Sat, 31 Jul 2021 21:49:00 +0000 (23:49 +0200)]
Fix `u' binding in Gnus Browse mode
* lisp/gnus/gnus-srvr.el (gnus-browse-mode-map): Bind to
`gnus-browse-toggle-subscription-at-point', which is the command.
Mattias Engdegård [Sat, 31 Jul 2021 21:44:17 +0000 (23:44 +0200)]
; compilation-error-regexp-alist-alist): eval-when-compile
Mattias Engdegård [Sat, 31 Jul 2021 20:37:03 +0000 (22:37 +0200)]
Occur-mode multi-line match property gap filling
When an occur-mode regexp matches across multiple lines, the spacing
prefixes inserted between each did not have the `occur-target`
property which is essential for jumping to the corresponding place in
the target buffer. This prevented next-error and previous-error
from working.
* lisp/replace.el (occur-engine): Put the `occur-target` property on
the continuation prefix to avoid the gap.
Mattias Engdegård [Sat, 31 Jul 2021 09:22:37 +0000 (11:22 +0200)]
* etc/NEWS: Mention occur-mode highlight changes.
Lars Ingebrigtsen [Sat, 31 Jul 2021 20:36:19 +0000 (22:36 +0200)]
C-x 5 5 manual tweak
* doc/emacs/frames.texi (Creating Frames): Mention
other-frame-prefix function name.
Lars Ingebrigtsen [Sat, 31 Jul 2021 20:27:08 +0000 (22:27 +0200)]
Update NEWS tagging for a couple entries
Lars Ingebrigtsen [Sat, 31 Jul 2021 20:25:38 +0000 (22:25 +0200)]
Add an index entry for outline-minor-mode-cycle
* doc/emacs/text.texi (Outline Mode): Document outline-minor-mode-cycle.
Lars Ingebrigtsen [Sat, 31 Jul 2021 20:22:42 +0000 (22:22 +0200)]
Document outline-minor-mode-cycle in the manual.
* doc/emacs/text.texi (Outline Mode): Document outline-minor-mode-cycle.
Lars Ingebrigtsen [Sat, 31 Jul 2021 17:51:16 +0000 (19:51 +0200)]
Make `ffap-read-file-or-url' work again (to read URLs)
* lisp/ffap.el (ffap--url-file-handler): New function (bug#44822).
(ffap-read-file-or-url): Use it to allow switching between URLs
and files.
Lars Ingebrigtsen [Sat, 31 Jul 2021 16:44:02 +0000 (18:44 +0200)]
Add new user option python-forward-sexp-function
* lisp/progmodes/python.el (python-forward-sexp-function): New
user option (bug#41361).
(python-mode): Use it.
Lars Ingebrigtsen [Sat, 31 Jul 2021 15:44:43 +0000 (17:44 +0200)]
Adjust how `replace-match' runs modification hooks
* src/editfns.c (Fsubst_char_in_region)
(Ftranslate_region_internal):
* src/cmds.c (internal_self_insert): Update callers.
* src/insdel.c (replace_range): Allow inhibiting
signal_after_change/update_compositions.
* src/lisp.h: Update.
* src/search.c (Freplace_match): Run the modification hooks at the
end instead of before adjusting point (bug#42424).
Lars Ingebrigtsen [Sat, 31 Jul 2021 14:52:44 +0000 (16:52 +0200)]
Extend whitespace-empty to the end of the line
* lisp/whitespace.el (whitespace-empty): Restore Emacs 26 look by
extending the face (bug#42112).
Lars Ingebrigtsen [Sat, 31 Jul 2021 12:54:52 +0000 (14:54 +0200)]
Revert "Fix `speedbar-directory-buttons' when using Tramp"
This reverts commit
5afad3918bc8816b74e8efcff9cc441785446aa6.
This patch can't possibly be correct, and it breaks the stated interface.
Lars Ingebrigtsen [Sat, 31 Jul 2021 11:37:42 +0000 (13:37 +0200)]
Revert "Allow nil initializers in define-minor-mode"
This reverts commit
02cbb37de73d563149389615ee44741322007108.
This was mistakenly commited and doesn't really make much sense.
Lars Ingebrigtsen [Sat, 31 Jul 2021 11:26:26 +0000 (13:26 +0200)]
Don't bind <mouse-2> and RET in *Help* buffers
* lisp/help-mode.el (help-mode-map): Remove key bindings for RET
and <mouse-2> (bug#49784).
(help-xref-stack, help-xref-forward-stack, help-xref-stack-item)
(help-make-xrefs): Fix doc strings -- these aren't used by
`help-follow', but by `help-follow-symbol'.
(help-follow-mouse, help-follow): Make obsolete.
Lars Ingebrigtsen [Fri, 30 Jul 2021 16:25:12 +0000 (18:25 +0200)]
Allow nil initializers in define-minor-mode
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Make the
meaning of :initialize nil and a missing :initialize the same.
Alan Third [Wed, 23 Jun 2021 15:07:12 +0000 (16:07 +0100)]
Fix some macOS problems
* src/nsmenu.m (update_frame_tool_bar): Make sure the toolbar isn't
displayed when it's not supposed to be.
* src/nsterm.m ([EmacsView layoutSublayersOfLayer:]): Reinstate code
intended to prevent a crash when running redisplay.
Alan Third [Sat, 12 Jun 2021 18:04:02 +0000 (19:04 +0100)]
Move parent frame setting code into EmacsWindow
* src/nsterm.m (ns_make_frame_visible):
(ns_set_parent_frame):
([EmacsWindow initWithEmacsFrame:fullscreen:screen:]): Use new method.
([EmacsWindow setParentChildRelationships]): New method.
Alan Third [Sat, 12 Jun 2021 11:52:15 +0000 (12:52 +0100)]
Move NS port toolbar handling to the window
* src/nsmenu.m (free_frame_tool_bar):
(update_frame_tool_bar): Remove wait_for_tool_bar and get the toolbar
from the window.
* src/nsterm.h (EmacsView): Remove toolbar and wait_for_tool_bar.
* src/nsterm.m (ns_update_begin):
([EmacsView windowDidEnterFullScreen]):
([EmacsView windowDidExitFullScreen]): Get the toolbar from the
window, not the view.
([EmacsView dealloc]): Remove toolbar from view.
([EmacsView createToolbar:]): Move method to EmacsWindow.
([EmacsView initFrameFromEmacs:]): Don't create toolbar here any more.
([EmacsView toolbar]): Remove method.
([EmacsWindow initWithEmacsFrame:fullscreen:screen:]): Create toolbar here.
([EmacsWindow createToolbar:]): Moved from EmacsView.
([EmacsWindow dealloc]): Make sure we clean up the toolbar after
closing the window.
Alan Third [Sat, 12 Jun 2021 09:25:47 +0000 (10:25 +0100)]
Fix macOS live resize drawing
* src/nsterm.m ([EmacsView layout]):
([EmacsView layoutSublayersOfLayer:]): Rename layout to
layoutSublayersOfLayer.
Alan Third [Wed, 9 Jun 2021 16:57:00 +0000 (17:57 +0100)]
Change NS port resize detection
* src/nsterm.m ([EmacsView windowDidResize:]): Remove function, it's
not performing a useful function any more.
([EmacsView viewDidResize]):
([EmacsView resizeWithOldSuperviewSize:]): Replace viewDidResize with
resizeWithOldSuperviewSize.
([EmacsView initFrameFromEmacs:]): Remove the view resize notification
as we don't need it any more.
Alan Third [Sat, 5 Jun 2021 11:39:46 +0000 (12:39 +0100)]
Tidy up NS port OS window handling
* src/nsterm.h (EmacsWindow): Move above EmacsView definition and add
new method definitions.
(EmacsView): Remove redundant bwidth variable, and change NSWindow to
EmacsWindow.
(EmacsFSWindow): Delete definition.
* src/nsterm.m (ns_set_undecorated): Rewrite to work in GNUstep using
the new OS window creating methods.
([EmacsView initFrameFromEmacs:]): Move all NSWindow related code to
new init method in EmacsWindow, and use said method.
([EmacsView toggleFullScreen:]): Use EmacsWindow instead of NSWindow.
([EmacsWindow initWithEmacsFrame:]):
([EmacsWindow initWithEmacsFrame:fullscreen:screen:]):
([EmacsWindow borderWidth]): New methods.
(EmacsFSWindow): Remove implementation.
Alan Third [Sat, 29 May 2021 08:48:51 +0000 (09:48 +0100)]
Simplify macOS drawing code
Convert EmacsSurface into a CALayer subclass so we can use the
built-in relationships. Also simplify the macOS versioning code.
This will result in more warnings on older versions of macOS but makes
reading the code easier.
* configure.ac: Add QuartzCore framework.
* src/nsterm.h (NS_DRAW_TO_BUFFER): Remove define and all references.
(EmacsSurface, EmacsLayer): Rename EmacsSurface to EmacsLayer and
modify the definition to fit the new function.
* src/nsterm.m (ns_update_begin):
(ns_update_end):
(ns_focus):
(ns_unfocus): Use the new overridden lockFocus and unlockFocus and
simplify the frame management.
([EmacsView dealloc]):
([EmacsView viewDidResize:]):Don't explicitly release surfaces.
([EmacsView initFrameFromEmacs:]): Move the layer code to after the
NSWindow has been created as creating the layer now relies on some of
it's properties.
([EmacsView makeBackingLayer]): New function.
([EmacsView lockFocus]):
([EmacsView focusOnDrawingBuffer]): Rename to lockFocus.
([EmacsView unlockFocus]):
([EmacsView unfocusDrawingBuffer]): Rename to unlockFocus.
([EmacsView windowDidChangeBackingProperties]): Don't explicitly
release surfaces but reset EmacsLayer properties.
([EmacsView layout]):
([EmacsView viewWillDraw]): Rename to layout.
([EmacsView wantsUpdateLayer]): Remove function and change all callers
to [EmacsView wantsLayer].
(EmacsSurface, EmacsLayer): Rename to EmacsLayer.
([EmacsSurface getSize]):
([EmacsSurface initWithSize:ColorSpace:Scale:]): Remove methods.
([EmacsSurface initWithColorSpace:]):
([EmacsLayer checkDimensions]):
([EmacsLayer releaseSurfaces]):
([EmacsLayer display]): New functions.
* src/nsterm.m ([EmacsLayer dealloc]): Use releaseSurfaces.
([EmacsSurface getContext]): Automatically detect frame property
changes and clear the cache if required. Use built-in CALayer
properties where available.
([EmacsLayer copyContentsTo:]): Use [CALayer contents] as source.
Eli Zaretskii [Sat, 31 Jul 2021 06:28:36 +0000 (09:28 +0300)]
* src/fontset.c (check_fontset_name): A better fix for bug#49782.
Adam Porter [Mon, 9 Mar 2020 18:01:32 +0000 (13:01 -0500)]
* lisp/emacs-lisp/cl-macs.el: Add cl-type pattern
* lisp/emacs-lisp/cl-macs.el:
((pcase-defmacro type)): Add 'cl-type' pattern.
* test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-cl-type): Add test.
* doc/lispref/control.texi (pcase Macro): Update manual.
With thanks to Stefan Monnier and Eli Zaretskii for their guidance.
Eli Zaretskii [Fri, 30 Jul 2021 18:51:59 +0000 (21:51 +0300)]
* src/fontset.c (check_fontset_name): Fix last change.
Eli Zaretskii [Fri, 30 Jul 2021 18:17:58 +0000 (21:17 +0300)]
Avoid segfault when set-fontset-font is called from non-GUI frames
* src/fontset.c (check_fontset_name): Avoid crashes if this is
called from a non-GUI frame. (Bug#49782)
Michael Albinus [Fri, 30 Jul 2021 15:19:29 +0000 (17:19 +0200)]
Change Tramp version to "2.5.2-pre"
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.5.2-pre".
Stephen Gildea [Fri, 30 Jul 2021 13:32:41 +0000 (06:32 -0700)]
; fix 2 typos in MH-E comments
* lisp/mh-e/ChangeLog.1: fix typo
* lisp/mh-e/mh-junk.el (mh-junk-allowlist): fix verb tense
Dmitry Gutov [Fri, 30 Jul 2021 12:58:25 +0000 (14:58 +0200)]
Make fileloop skip missing files
* lisp/fileloop.el (fileloop-next-file): If a file doesn't exist,
skip to the next one (bug#44979).
Maxim Nikulin [Fri, 30 Jul 2021 12:42:07 +0000 (14:42 +0200)]
Tweak previous mailcap-view-file change
* lisp/net/mailcap.el (mailcap-view-file): Remove the :noquery t
mistakenly added (bug#12972).
Copyright-paperwork-exempt: yes
k3tu0isui [Fri, 30 Jul 2021 12:39:13 +0000 (14:39 +0200)]
Fix problem when switching between different prolog versions
* lisp/progmodes/prolog.el (run-prolog): Make switching between
different prolog systems work more reliably (bug#45795).
* lisp/progmodes/prolog.el (prolog-ensure-process): Don't start a
new process if one already exists.
Copyright-paperwork-exempt: yes
Mattias Engdegård [Fri, 30 Jul 2021 10:22:01 +0000 (12:22 +0200)]
Simplify lexical let-optimisations
Ensure in cconv that let-bindings have the normal form (VAR EXPR)
where VAR is a valid variable name, so that we don't need to keep
re-checking this all the time in the optimiser.
* lisp/emacs-lisp/byte-opt.el
(byte-optimize-enable-variable-constprop)
(byte-optimize-warn-eliminated-variable): Remove; these were mainly
used for debugging.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-let-form):
Assume normalised let-bindings (with lexical-binding).
Stop using the variables removed above.
* lisp/emacs-lisp/cconv.el (cconv-convert): Ensure normalised
let-bindings. Malformed bindings are dropped after warning.
remove byte-optimize-warn-eliminated-variable
Lars Ingebrigtsen [Fri, 30 Jul 2021 12:07:04 +0000 (14:07 +0200)]
Ensure that recover-file doesn't leave stale auto-save files behind
* lisp/files.el (recover-file): Don't leave stale auto-save files
behind after crash recovery (bug#11331).
Lars Ingebrigtsen [Fri, 30 Jul 2021 12:03:43 +0000 (14:03 +0200)]
Allow shell PROMPT strings to have ANSI codes
* lisp/comint.el (comint-output-filter): Don't overwrite ANSI
codes from the prompt command (bug#11883).
Max Nikulin [Fri, 30 Jul 2021 12:00:41 +0000 (14:00 +0200)]
mailcap.el: Avoid xdg-open silent failure
* lisp/net/mailcap.el (mailcap-view-file): Use 'pipe :connection-type
instead of 'pty to prevent killing of background process on handler
exit. Avoid regression similar to Bug#44824.
Problem happens only in some desktop environments where mailcap handler
launches actual viewer (as defined in .desktop files and obtained from
mimeapps.list) in background. E.g. xdg-open invokes "gio open" or
kde-open5 for Gnome or KDE accordingly and these handlers launch e.g.
eog or okular in background. As soon as main process exits, temporary
terminal session created by `start-process-shell-command' is terminated.
As a result background processes receive SIGHUP.
Previously command were executed with no buffer as well, so the change
does not affect "needsterminal" and "copiousoutput" mailcap features,
they are not supported as earlier.
If main process of the handler fails then show a message with exit
reason. Output (including error messages) is ignored as before.
Gtk applications tend to report significant amount of failed asserts
hardly informative for majority of users (bug#12972).
Copyright-paperwork-exempt: yes
Lars Ingebrigtsen [Fri, 30 Jul 2021 11:51:46 +0000 (13:51 +0200)]
Fix case insensitivity in `read-file-name'
* lisp/minibuffer.el (read-file-name-default): Make `read-file-name'
actually respect `read-file-name-completion-ignore-case' (bug#14340).
Lars Ingebrigtsen [Fri, 30 Jul 2021 11:32:54 +0000 (13:32 +0200)]
Fix issue with mml-preview from outside Gnus
* lisp/gnus/gnus-art.el (gnus-mime-display-alternative): Be more
resilient when running from outside Gnus.
Lars Ingebrigtsen [Fri, 30 Jul 2021 11:13:46 +0000 (13:13 +0200)]
Work around long-standing seq.el compilation warning
* lisp/emacs-lisp/seq.el (seq-contains): When using cl-defgeneric
to define an obsolete function, it'll complain about it being
obsolete. Suppress that warning. (Should probably be fixed in
cl-defgeneric instead.)
Basil L. Contovounesios [Fri, 30 Jul 2021 10:30:53 +0000 (11:30 +0100)]
Remove a redundant let-binding from Ispell
Recent optimizer changes revealed a case-fold-search binding in
Ispell that was made redundant in the revision of 2020-11-03
"Simplify ispell-check-version’s use of -vv flag".
* lisp/textmodes/ispell.el (ispell-check-version): Remove no-op
binding of case-fold-search.
Michael Albinus [Fri, 30 Jul 2021 09:57:50 +0000 (11:57 +0200)]
* etc/NEWS: Tramp supports authentication via yubikey now. Fix typos.
Michael Albinus [Fri, 30 Jul 2021 09:57:39 +0000 (11:57 +0200)]
Fix bug#49773 in Tramp
* lisp/net/tramp.el (tramp-handle-find-backup-file-name)
(tramp-handle-lock-file, tramp-handle-make-auto-save-file-name):
Check security hole only if action is in progress. (Bug#49773)
Mattias Engdegård [Thu, 29 Jul 2021 13:35:55 +0000 (15:35 +0200)]
Optimise let and let* whose body is constant or the last variable
Simplify (let ((X1 E1) ... (Xn En)) Xn)
=> (progn E1 ... En)
and (let* ((X1 E1) ... (Xn En)) Xn)
=> (let* ((X1 E1) ... (Xn-1 En-1)) En)
and similarly the case where the body is a constant, extending a
previous optimisation that only applied to the constant nil.
This reduces the number of bound variables, shortens the code, and
enables further optimisations.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-letX): Rewrite using
`pcase` and add the aforementioned transformations.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test cases.
Mattias Engdegård [Thu, 29 Jul 2021 15:20:41 +0000 (17:20 +0200)]
Move warnings about bad let-bindings from source optimiser to cconv
* lisp/emacs-lisp/byte-opt.el (byte-optimize-let-form): Move warnings...
* lisp/emacs-lisp/cconv.el (cconv-convert): ...here, which is an
overall better place (closer to the front-end).
Mattias Engdegård [Thu, 29 Jul 2021 08:07:26 +0000 (10:07 +0200)]
Optimise prog1 better
Rewrite (prog1 CONST FORMS...) => (progn FORMS... CONST)
where CONST is a compile-time constant, because putting the value last
allows the lapcode peephole pass to do important improvements like
branch elimination. Also use progn instead of prog1 for `ignore`.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
New `prog1` and `ignore` transforms.
Mattias Engdegård [Wed, 28 Jul 2021 15:31:44 +0000 (17:31 +0200)]
Elide lexical variables in for-effect context in source optimiser
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Remove for-effect uses of lexical variables. We previously relied on
this being done by the lapcode peephole optimiser but at source level
it enables more optimisation opportunities.
Keywords are elided for the same reason.